<template>
  <div>
  <div class="kystop-bar">
    <div class="kysheader-box">
      <div class="kystop-reg-log l">
				<span class="kysgo-log">欢迎光临本网站,请先 <a href="/themes4">登录</a>/
					<a href="/register4">注册</a></span>
        <span class="kysquick-log">
					<a  class="layui-btn" href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=101797373&redirect_uri=http%3A%2F%2Fqq.xinkashou.com%2Fqq%2FreturnUser&state=test.333ks.cn"

             target="_blank">QQ登录</a> <!--              :href="pageData.qq" :href="pageData.wx"-->
					<a href=""
             class="layui-btn" target="_blank" style="margin-left: 6px;background: #009944;">微信登录</a>
				</span>
      </div>
      <div class="kystop-r-menu">
        <ul class="kysfix">
          <li class="kyskyst-item"><a href="/orders">我的订单</a></li>
          <li class="kyskyst-item"><a href="/complain">我的投诉</a></li>
          <li class="kyst-item"><a href="/charge"
                                   class="topchongzhi layui-btn">充值</a></li>
          <li class="kyskyst-item">
            <a onclick="return confirm(&#39;有事请直奔主题,不要问在不在&#39;)"
               target="_blank" :href="systemStyle.qqLink"
               class="topkf" style="border-left: 1px solid #999;">联系客服</a>
          </li>
          <li class="kyst-item" style="padding: 0 1px;">
            <a href="/account" class="topkf" style="padding: 0 1px;">个人中心</a></li>
          <li  class="kyst-item" style="padding: 0 1px;" v-for="(item, index) in linkMenuDataTop" :key="index" v-if="index < 3">
                <a class="topkf" style="padding: 0 1px;" v-if="item.menuTips" target="_blank" :href="item.menuLink">{{
                    item.menuName
                  }}</a>
          </li>
            <li class="kyst-item" style="padding: 0 1px;"  v-else>
              <a class="topkf"
                 style="padding: 0 1px;" target="_blank" :href="item.menuLink">{{
                  item.menuName
                }}</a>
            </li>

        </ul>
      </div>
    </div>
  </div>
  <div class="common-header">
    <div class="common-container header-box">
      <a href="/">
        <img src="http://static.kayisu.com/Uploads/KAYISU/10561/2020-07-20/5f15700f0f023.png" alt="网站logo图片"
             title="" class="logoimg">
      </a>

      <ul>
        <li><a href="/" :class="{ headernavactive: idx === 0 }">首页</a></li>
        <li><a href="/register" :class="{ headernavactive: idx === 1 }">用户注册</a></li>
        <li><a href="/notice" :class="{ headernavactive: idx === 2 }">公告信息</a></li>
        <li v-for="(item, index) in linkMenuDataTop" :key="index"  >
                <a :class="{ headernavactive: idx === index }" target="_blank" :href="item.menuLink">{{
                    item.menuName
                  }}</a>
        </li>
<!--            <li  v-else>-->
<!--              <a :class="{ headernavactive: idx === index }" :href="item.menuLink">{{-->
<!--                  item.menuName-->
<!--                }}</a>-->
<!--            </li>-->

        <a href="javascript:void(0)" v-if="linkMenuDataTop.length>3" @click="showMoreBaiduLink">更多</a>
      </ul>
      <div class="kys-madestyle-search">
        <form action="" method="post" class="layui-form">
          <div class="layui-input-inline" style="width:200px;">
            <input type="text" name="_keyword" required="" lay-verify="required" placeholder="请输入关键词"
                   autocomplete="off" class="layui-input">
          </div>
          <div class="layui-input-inline">
            <button class="layui-btn kys-madestyle-searchbtn" lay-submit="" lay-filter="search">搜索</button>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
</template>

<script>
import { mapState } from 'vuex'
import fixupMixin from '@/mixins/fixup'
import qqservice from './qqservice'

export default {
  components: {
    qqservice
  },
  mixins: [fixupMixin],
  props: {
    title: {
      type: String,
      default: ''
    },
    qqLink: String,
    qunLink: String

    // pageData: {
    //   type: Object,
    //   required: true
    // }
  },
  data() {
    let idx = -1
    if (this.$route.name === 'index4') {
      idx = 0
    } else if (this.$route.name === 'register4') {
      idx = 1
    } else if (~this.$route.name.indexOf('notice')) {
      idx = 2
    }
    return {
      idx,
      linkMenuDataTop: []
    }
  },
  created () {
    // console.log('pageData', this.pageData)
    this.getLinkMenuList()
  },
  computed: {
    ...mapState({
      site: (state) => state.site,
      systemStyle: (state) => state.systemStyle
    })
  },
  methods: { setHomePage() {}, addToFav() {},
  async getLinkMenuList() {
      let that = this
      const res = await this.$axios.get('/site/customMenu/listForDomain')
      if (res.code === 1001) {
        if (res.body) {
          that.linkMenuDataTop = res.body
        }
      }
    }, }
}
</script>

<style lang="scss" scoped>
@import 'assets/style/layer.css';
@import 'assets/style/layui.css';
@import 'assets/style/style1/common.css';
@import 'assets/style/style1/openlogin.css';
@import 'assets/style/style1/style.css';
@import 'assets/style/style1/font_1451715_0505c2bxv7b7.css';
</style>
